<?php
// 设置时区
date_default_timezone_set('Asia/Shanghai');
@session_start();
// 计算根目录
define("YUEXUAN_REAL_ROOT_PATH", substr(dirname(__FILE__), 0, -4));

include_once dirname(__FILE__).'/config.php';
include_once dirname(__FILE__).'/functions.php';

$accountTypeList = array(
	"现金", "虚拟账户", "信用卡"
	//, "储值券卡", "重大资产", "应收款", "应付款", "证券账户", "基金账户", "在线支付", "待摊费用"
);

// 自动加载类文件
function __autoload($className) {
	$libPath = YUEXUAN_REAL_ROOT_PATH."/lib/";
	$classFileName = str_replace("_", "/", $className).".class.php";
	require_once ($libPath.$classFileName);
}

//$logger = ext_logger::getInstance();

if(!isset($doNotAuth) || !$doNotAuth){
	// 验证是否登录
	$userId = isset($_SESSION["userId"])?$_SESSION["userId"]:"";
	if(!$userId){
		if(isAjax()){
			$result = array(
				'success' => false,
				'needLogin' => true,
				'message'=>"请先登录"
			);
			$jsonHandle = new ext_jsonHandle();
			$jsonHandle->jsonOut($result);
		}else{
			echo '<meta http-equiv="refresh" content="0;url=/login.php">';
		}
		exit();
	}
}

$now_date = date("Y-m-d");
$userId = isset($_SESSION["userId"])?$_SESSION["userId"]:0;
$userInfo = isset($_SESSION["userInfo"])?$_SESSION["userInfo"]:array();
